<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1{
            width: 300px;
            height: 300px;
            /* background-color: yellow; */
            /* background-color: rgb(255, 0, 0); */
            background-color: #ff0000;
            /* 透明度 */
            /* background-color: rgba(255, 0, 0, 0.5); */
        }
        .box2{
            width: 100px;
            height: 100px;
            background-color: rgba(0, 0, 0, 0.5);
        }
        
    </style>
</head>
<body>
    <div class="box1">
        大家好
        <div class="box2"></div>
    </div>
</body>
</html>